Repository navigation
libraries: honour SPC_DEFAULT_CFLAGS/CXXFLAGS/LDFLAGS and bug fixes - #1166
Conversation
bzip2, fastlz, jbig, qdbm: thread SPC_DEFAULT_CFLAGS into the
hand-rolled Makefile patches and shell compile commands. Backward
compatible when the env var is empty.
icu: append SPC_DEFAULT_CXXFLAGS/LDFLAGS to runConfigureICU's CXXFLAGS
and LDFLAGS so user flags reach the bundled cxx invocation.
openssl: append user CFLAGS/LDFLAGS after the target name on Configure
so options like -flto and -fprofile-* reach the openssl build.
libheif: rewrite libheif 1.22+'s C-incompatible
`struct heif_bad_pixel { uint32_t row; uint32_t column; };` as a
typedef so C consumers compile.
ncurses: filter the clang/zig-cc "N warning(s) generated." stdout line
out of MKlib_gen.sh's preprocessor pipe before sed turns it into
invalid C in lib_gen.c.
libaom: detect target CPU from SystemTarget instead of hard-coding
generic, fall back to generic only when neither nasm nor yasm is
available, and turn off examples/tests/tools/docs.
c53f6ad to
29a8c9c
Compare
|
StaticPHP Test Bot Detected: Extensions: |
# Conflicts: # src/Package/Library/bzip2.php # src/Package/Library/libaom.php
libuv 1.53.0 calls WaitOnAddress()/WakeByAddressSingle() from
src/win/pipe.c. Those symbols live in synchronization.lib (Win8+), and
libuv's CMake lists "synchronization" in uv_libraries only for its own
CMake targets. uv_a is a static archive, so the dependency does not
propagate to php.exe, which links libuv.lib directly and therefore must
pass the system library itself.
Without it the Windows uv matrix job fails at link time:
libuv.lib(pipe.obj) : error LNK2001: unresolved external symbol WaitOnAddress
libuv.lib(pipe.obj) : error LNK2001: unresolved external symbol WakeByAddressSingle
php.exe : fatal error LNK1120: 2 unresolved externals
Inject CHECK_LIB("synchronization.lib", ...) next to the dbghelp.lib one we
already add, so LIBS_UV carries it into the php.exe / CGI / embed links.
EXTENSION() is decided earlier, so a missing library still only warns.
Windows-only: the hook runs in php::buildconfForWindows.
| if ($extra !== '') { | ||
| FileSystem::replaceFileRegex($lib->getSourceDir() . '/Makefile', '/^CFLAGS = .*$/m', "CFLAGS = -Wall {$extra}"); | ||
| } | ||
| $ac->make(SystemTarget::getTargetOS() === 'Darwin' ? 'mac' : ''); |
There was a problem hiding this comment.
macOS may need different patch position:
FileSystem::replaceFileRegex(
$path . '/Makefile',
'/^(\tmake MYLIBS="\$\(MYMACLIBS\)" CFLAGS=")[^"]*(")$/m',
"$1-Wall -fsigned-char -fno-common -O2 {$extra}$2"
);There was a problem hiding this comment.
could you commit that yourself? I can't test it :(
|
This PR looks clean, we could fix red CI in another pr. |
bzip2, fastlz, jbig, qdbm: thread SPC_DEFAULT_CFLAGS into the hand-rolled Makefile patches and shell compile commands. Backward compatible when the env var is empty.
icu: append SPC_DEFAULT_CXXFLAGS/LDFLAGS to runConfigureICU's CXXFLAGS and LDFLAGS so user flags reach the bundled cxx invocation.
openssl: append user CFLAGS/LDFLAGS after the target name on Configure so options like -flto and -fprofile-* reach the openssl build.
liblz4: replace placeholder Makefile patch ("installewfwef") with a real one that compiles each lib source individually --
clang -flto -cwith multiple inputs only writes a .o for the first, silently dropping the rest and leaving liblz4.a with a single object.libheif: rewrite libheif 1.22+'s C-incompatible
struct heif_bad_pixel { uint32_t row; uint32_t column; };as a typedef so C consumers compile.ncurses: filter the clang/zig-cc "N warning(s) generated." stdout line out of MKlib_gen.sh's preprocessor pipe before sed turns it into invalid C in lib_gen.c.
libaom: detect target CPU from SystemTarget instead of hard-coding generic, fall back to generic only when neither nasm nor yasm is available, and turn off examples/tests/tools/docs.
What does this PR do?
Checklist before merging
*.phpor*.yml, run them locally to ensure your changes are valid:composer cs-fixcomposer analysecomposer testbin/spc dev:lint-config